<template>
    <view class="container">

        <!-- 主要内容区域 -->
        <view class="content">
            <!-- 基本信息列表 -->
            <view class="info-list">
                <view 
                    class="info-item" 
                    v-for="item in basicInfoList" 
                    :key="item.key"
                >
                    <view class="info-label">
                        <text class="label-text">{{ item.label }}</text>
                    </view>
                    <view class="info-value">
                        <text 
                            class="value-text" 
                            :class="{ status: item.key === 'employeeStatus' }"
                        >
                            {{ item.value }}
                        </text>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script setup>
import { ref } from 'vue'

// 基本信息数据
const basicInfoList = ref([
    {
        key: 'employeeId',
        label: '工号',
        value: 'EMP202305168'
    },
    {
        key: 'name',
        label: '姓名',
        value: '陈思远'
    },
    {
        key: 'company',
        label: '入职公司',
        value: '远景科技有限公司'
    },
    {
        key: 'department',
        label: '所属部门',
        value: '研发中心-前端开发部'
    },
    {
        key: 'position',
        label: '岗位名称',
        value: '高级前端工程师'
    },
    {
        key: 'positionLevel',
        label: '岗位职级',
        value: 'P6'
    },
    {
        key: 'title',
        label: '职称',
        value: '中级工程师'
    },
    {
        key: 'employmentType',
        label: '入职类型',
        value: '全职'
    },
    {
        key: 'employeeStatus',
        label: '职员状态',
        value: '在职'
    }
])

// 返回上一页
function goBack() {
    uni.navigateBack()
}
</script>

<style>
.container {
    height: 100vh;
    background-color: #f5f5f5;
    padding: 0 30rpx;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 0 20rpx;
    padding-bottom: 40rpx;
    flex: 1;
    overflow-y: auto;
}

.info-list {
    background: #fff;
    border-radius: 16rpx;
    overflow: hidden;
    box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30rpx;
    border-bottom: 1rpx solid #f0f0f0;
    min-height: 88rpx;
    box-sizing: border-box;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    flex-shrink: 0;
    margin-right: 20rpx;
}

.label-text {
    font-size: 28rpx;
    color: #666;
    font-weight: 500;
}

.info-value {
    flex: 1;
    text-align: right;
}

.value-text {
    font-size: 28rpx;
    color: #333;
    line-height: 1.4;
    word-break: break-all;
}

.value-text.status {
    color: #4CAF50;
    font-weight: 500;
}
</style> 